package com.pic.mgt.syushin.executer;

import java.sql.Timestamp;
import java.util.HashMap;
import java.util.Map;

import com.pic.mgt.dao.TargetMessageDao;
import com.pic.mgt.dao.syushin.SyushinTargetMessageDao;
import com.pic.mgt.executer.IGXTypeExecutionException;
import com.pic.mgt.syushin.unit.BucketOkSyushinMessageUnit;
import com.pic.mgt.syushin.unit.SyushinMessage;

public final class BucketSyushinMessageUnitExecuter extends
		SyushinMessageUnitExecuter {

	@Override
	protected void executeIGXType() throws IGXTypeExecutionException {
		
	}
	
	@Override
	protected Map<String, Object> getInsertTargetMessageBasicValuesMap(SyushinMessage syushinMessage) {
		BucketOkSyushinMessageUnit bucketOkSyushinMessageUnit =
									(BucketOkSyushinMessageUnit)syushinMessage;
		
		Map<String ,Object> insertValuesMap = new HashMap<String, Object>();

		insertValuesMap.put(TargetMessageDao._confirmationFile, bucketOkSyushinMessageUnit.getConfirmationFilename());
		insertValuesMap.put(TargetMessageDao._transactionFile, bucketOkSyushinMessageUnit.getTransactionFilename());
		insertValuesMap.put(TargetMessageDao._transactionTime, new Timestamp(bucketOkSyushinMessageUnit.getTransactionTime().getTime()));
		insertValuesMap.put(TargetMessageDao._unitName, bucketOkSyushinMessageUnit.getUnitName());
		// (送多方新增)
		insertValuesMap.put(SyushinTargetMessageDao._apName, bucketOkSyushinMessageUnit.getApName());
		// Bucket Message 沒有端末ID
		insertValuesMap.put(TargetMessageDao._terminalId, null);

		return insertValuesMap;
	}

}
